package com.szq.pattern.web;

import com.szq.pattern.po.Activity;
import com.szq.pattern.po.ActivityFactory;
import com.szq.pattern.po.Stock;
import com.szq.pattern.util.RedisUtils;

/**
 * @description:
 * @author: szq
 * @date: 2021-09-09 17:02:49
 */
public class ActivityController {

    private RedisUtils redisUtils = new RedisUtils();

    public Activity queryActivityInfo(Long id){
        Activity activity = ActivityFactory.getActivity(id);
        Stock stock = new Stock(100, redisUtils.getStockUsed());
        activity.setStock(stock);
        return activity;
    }
}
